home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
MacApp
/
MacApp 2.0.1
/
Experimental enhancements
/
MacApp Sizers
/
SizerTest.r
< prev
next >
Wrap
Text File
|
1990-11-08
|
9KB
|
310 lines
/* • Auto-Include the requirements for this source */
#ifndef __TYPES.R__
#include "Types.r"
#endif
#ifndef __SYSTYPES.R__
#include "SysTypes.r"
#endif
#ifndef __MacAppTypes__
#include "MacAppTypes.r"
#endif
#ifndef __ViewTypes__
#include "ViewTypes.r"
#endif
#if qDebug
include "Debug.r.o";
#endif
include "MacApp.r.o";
include "Dialog.r.o";
include $$Shell("ObjApp")$$Shell("XAppName") 'CODE';
#define kSignature 'Test' // Application signature
#define kFileType 'test' // Data file type
#define listFont plain, 9, {0, 0, 0}, "geneva"
/* Include resources from the Sizer unit */
#include "USizerView.r"
/* Commands */
#define cNewTestWindow 1200 // Create a new test window procedurally
#define cNewSplitHWindow 1205 // Create a new window with horizontal sizer & splitter
#define cNewSplitVWindow 1206 // Create a new window with vertical sizer & splitter
/* Resources */
#define kTestWindowID 1001 // ID of the main window
#define kSplitHWindowId 1205 // Window resource for cNewSplitHWindow
#define kSplitVWindowId 1206 // Window resource for cNewSplitVWindow
#define mTest 4
/* STR# resources for 4-pane SizerView */
#define kStringList1 2000
#define kStringList2 2001
#define kStringList3 2002
#define kStringList4 2003
/* Miscellaneous constants */
#define kWindowWidth 400
#define kWindowHeight 400
#define kListPaneWidth 100-kSBarSizeMinus1
#define kListPaneHeight 200
resource 'view' (kTestWindowID, "TestWindowType", purgeable) {
{
root, 'WIND', { 30, 30 }, { kWindowHeight, kWindowWidth }, sizeVariable, sizeVariable,
notShown, enabled,
Window { "", zoomDocProc, goAwayBox, resizable, modeless,
ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
openWithDocument, dontAdaptToScreen, stagger, dontForceOnScreen,
dontCenter, 'aaaa', "SizerView Test" };
'WIND', 'main', { 0, 0 }, { kWindowHeight, kWindowWidth },
sizeSuperView, sizeSuperView, shown, enabled,
View { "THorizontalSizer" };
'main', 'lowr', { 203, 0 }, { 197, kWindowWidth },
sizeRelSuperView, sizeSuperView, shown, enabled,
View { "TTestView" };
'main', 'uppr', { 0, 0 }, { kListPaneHeight, kWindowWidth },
sizeRelSuperView, sizeSuperView, shown, enabled,
View { "TVerticalSizer" };
'uppr', 'SCL1', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
sizeSuperView, sizeRelSuperView, shown, enabled,
Scroller { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
'SCL1', 'aaaa', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
sizeVariable, sizeSuperView, shown, enabled,
TextListView { "TTestListView", 0, 1, 12, 12, 0, 4,
dontAdornRows, dontAdornCols, singleSelection, listFont };
'uppr', 'SCL3', { 0, 160 }, { kListPaneHeight, kListPaneWidth },
sizeSuperView, sizeRelSuperView, shown, enabled,
Scroller { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
'SCL3', 'cccc', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
sizeVariable, sizeSuperView, shown, enabled,
TextListView { "TTestListView", 0, 1, 12, 12, 0, 4,
dontAdornRows, dontAdornCols, singleSelection, listFont };
'uppr', 'SCL2', { 0, 80 }, { kListPaneHeight, kListPaneWidth },
sizeSuperView, sizeRelSuperView, shown, enabled,
Scroller { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
'SCL2', 'bbbb', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
sizeVariable, sizeSuperView, shown, enabled,
TextListView { "TTestListView", 0, 1, 12, 12, 0, 4,
dontAdornRows, dontAdornCols, singleSelection, listFont };
'uppr', 'SCL4', { 0, 240 }, { kListPaneHeight, kListPaneWidth },
sizeSuperView, sizeRelSuperView, shown, enabled,
Scroller { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
'SCL4', 'dddd', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
sizeVariable, sizeSuperView, shown, enabled,
TextListView { "TTestListView", 0, 1, 12, 12, 0, 4,
dontAdornRows, dontAdornCols, singleSelection, listFont };
}
};
resource 'STR#' (kStringList1) {
{
/* [1] */ "One";
/* [2] */ "Two";
/* [3] */ "Three";
/* [4] */ "Four";
/* [5] */ "Five";
/* [6] */ "Six";
/* [7] */ "Seven";
/* [8] */ "Eight";
/* [9] */ "Nine"
}
};
resource 'STR#' (kStringList2) {
{
/* [1] */ "First";
/* [2] */ "Second";
/* [3] */ "Third";
/* [4] */ "Fourth";
/* [5] */ "Fifth";
/* [6] */ "Sixth";
/* [7] */ "Seventh";
/* [8] */ "Eighth"
}
};
resource 'STR#' (kStringList3) {
{
/* [1] */ "1";
/* [2] */ "2";
/* [3] */ "3";
/* [4] */ "4";
/* [5] */ "5";
/* [6] */ "6";
/* [7] */ "7";
/* [8] */ "8";
/* [9] */ "9";
/* [10] */ "10";
/* [11] */ "11";
/* [12] */ "12";
}
};
resource 'STR#' (kStringList4) {
{
/* [1] */ "a";
/* [2] */ "b";
/* [3] */ "c";
/* [4] */ "d";
/* [5] */ "e";
/* [6] */ "f";
/* [7] */ "g";
/* [8] */ "h";
/* [9] */ "i"
}
};
#define kWindowWidth 300
#define kWindowHeight 400
#define kSplitterThickness 6 // thickness of a TSplitter
resource 'view' (kSplitHWindowId, "Horiz Split Window", purgeable) {
{
root, 'WIND', { 30, 30 }, { kWindowHeight, kWindowWidth }, sizeVariable, sizeVariable,
notShown, enabled,
Window { "", zoomDocProc, goAwayBox, resizable, modeless,
ignoreFirstClick, freeOnClosing, disposeOnFree, doesntCloseDocument,
dontOpenWithDocument, dontAdaptToScreen, stagger, dontForceOnScreen,
dontCenter, 'hsiz', "Horizontal Splitter Test" };
'WIND', 'hsiz', { 0, 0 }, { kWindowHeight, kWindowWidth },
sizeSuperView, sizeSuperView, shown, enabled,
View { "THorizontalSizer" };
'hsiz', 'SCLH', { 0, 0 }, { kWindowHeight-kSBarSizeMinus1, kWindowWidth-kSBarSizeMinus1 },
sizeRelSuperView, sizeRelSuperView, shown, enabled,
Scroller { "", vertScrollBar, noHorzScrollBar, 0, 0, 16, 16,
vertConstrain, noHorzConstrain, { kSplitterThickness, 0, 0, 0 } };
'SCLH', 'stpd', { 0, 0 }, { 500, kWindowWidth-kSBarSizeMinus1 },
sizeFixed, sizeSuperView, shown, enabled,
View { "TStupidView" };
'hsiz', 'SPLT', { 0, kWindowWidth-kSBarSizeMinus1 }, { kSplitterThickness, kSBarSizeMinus1 },
sizeFixed, sizeRelSuperView, shown, enabled,
Control { "TSplitter",
noAdornment, notSizeable, notDimmed, notHilited, doesntDismiss,
noInset, systemFont };
}
};
#define kWindowWidth 400
#define kWindowHeight 300
resource 'view' (kSplitVWindowId, "Vert Split Window", purgeable) {
{
root, 'WIND', { 30, 30 }, { kWindowHeight, kWindowWidth }, sizeVariable, sizeVariable,
notShown, enabled,
Window { "", zoomDocProc, goAwayBox, resizable, modeless,
ignoreFirstClick, freeOnClosing, disposeOnFree, doesntCloseDocument,
dontOpenWithDocument, dontAdaptToScreen, stagger, dontForceOnScreen,
dontCenter, 'vsiz', "Vertical Splitter Test" };
'WIND', 'vsiz', { 0, 0 }, { kWindowHeight, kWindowWidth },
sizeSuperView, sizeSuperView, shown, enabled,
View { "TVerticalSizer" };
'vsiz', 'SCLV', { 0, 0 }, { kWindowHeight-kSBarSizeMinus1, kWindowWidth-kSBarSizeMinus1 },
sizeRelSuperView, sizeRelSuperView, shown, enabled,
Scroller { "", noVertScrollBar, horzScrollBar, 0, 0, 16, 16,
noVertConstrain, horzConstrain, { 0, kSplitterThickness, 0, 0 } };
'SCLV', 'stpd', { 0, 0 }, { kWindowHeight-kSBarSizeMinus1, kWindowWidth },
sizeRelSuperView, sizeSuperView, shown, enabled,
View { "TStupidView" };
'vsiz', 'SPLT', { kWindowHeight-kSBarSizeMinus1, 0 }, { kSBarSizeMinus1, kSplitterThickness },
sizeRelSuperView, sizeFixed, shown, enabled,
Control { "TSplitter",
noAdornment, notSizeable, notDimmed, notHilited, doesntDismiss,
noInset, systemFont };
}
};
/******************** M E N U S ****************************************************/
include "Defaults.r.o" 'cmnu' (mApple); // Grab the default Apple menu
include "Defaults.r.o" 'cmnu' (mFile); // Grab the default File menu
include "Defaults.r.o" 'cmnu' (mEdit); // Grab the default Edit menu
resource 'cmnu' (mTest) {
mTest,
textMenuProc,
0x7FFFFFFB,
enabled,
"Test",
{
/* [1] */ "New Horizontal Split Window", noIcon, "1", check, plain, cNewSplitHWindow;
/* [2] */ "New Vertical Split Window", noIcon, "2", check, plain, cNewSplitVWindow
}
};
resource 'MBAR' (kMBarDisplayed) {
{ mApple; mFile; mEdit; mTest }
};
include "Defaults.r.o" 'ALRT' (phAboutApp); // Get default About Box
include "Defaults.r.o" 'DITL' (phAboutApp); // …and its item list
resource 'STR#' (kDefaultCredits, purgeable) {
{
"Keith Rollin";
"Lonnie Millett";
"Tom Chavez";
"The White Stalker";
"The Dark Fluffy"
}
};
/**********************************************************************************/
type kSignature as 'STR '; // Creator string
resource kSignature (0) {
"USizerView test program. MacApp is my friend." // the ID string as part of Bundle
};
/* The version of this application */
RESOURCE 'vers' (1, purgeable) {
0x01,
0x00,
development,
0x00,
verUs,
"1.0",
"Test 1.0, ©Apple Computer, Inc. 1990"
};